package com.web.dao.impl;

import com.web.dao.StudentIdDAO;
import com.web.entity.Student;
import com.web.util.JDBCUtils;

import java.util.List;

/**
 * @author lenovo
 * @Description
 * @Date2025-3-1 14:58
 */
public class StudentIdDAOImpl implements StudentIdDAO {
    @Override
    public Student selectStudentById(int id) {
        String sql = "select * from student_s where id=?";
        List<Student> students = JDBCUtils.query(Student.class, sql, id);
        if (students.size()> 0) {
            return students.get(0);
        } else {
            return null;
        }
    }
}
